Webスピード改善 taca10
this is how to improve web connection,
プロトコルバッファ
https://developers.google.com/protocol-buffers/
htaccessで「gzip圧縮」を有効化
ブラウザキャッシュ
reverse proxy pattern
client -> proxy -> app
tatoeba
browser => nginx => rails
Some good HTTP reverse proxy servers:
- Apache (old)
- Lighttpd
- Nginx (most used now, probably)
- Caddy (newest, maybe best) https://github.com/mholt/caddy
- Litespeed
Use modules to load JS, put them anywhere (head, body or footer), they will load in parallel
<script type="module" src="..."></script>
see https://stackoverflow.com/a/54482274/335847
Enable Compression
- gzip
- see https://developers.google.com/web/fundamentals/performance/optimizing-content-efficiency/optimize-encoding-and-transfer
Caching on the proxy or specific caching servings (Nginx/Varnish etc)
Use browser caching
- etags https://en.wikipedia.org/wiki/HTTP_ETag
- weak tags
Minify Resources (HTML, CSS, and JavaScript)
- better served by the proxy (Nginx/Apache etc)
Optimize Images
- better served by the proxy (Nginx/Apache etc)
Remove Render-Blocking JavaScript
Use a Content Delivery Network (CDN)
Use static pages where possible
- better served by the proxy (Nginx/Apache etc)
- app public folder
Use other frameworks than Rails like Grape or Sinatra for API, see https://github.com/CaDs/ruby_benchmarks for benchmarks.
プロキシとは
http://e-words.jp/w/プロキシ.html